﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Order_Address.aspx.cs" Inherits="Mall.Order.Order_Address" %>

<%@ Register Src="/usercontrol/Top.ascx" TagName="uchead" TagPrefix="headuc" %>
<%@ Register Src="/usercontrol/Footer.ascx" TagName="ucfooter" TagPrefix="footeruc" %>
 <% MODEL.MOrder model = new MODEL.MOrder();
    model = model_order;// TempData["model_order"] == null ? model : (MODEL.MOrder)TempData["model_order"];
    Session["model_order"] = model;
  %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>收货地址</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK media=screen href="/content/images/mkl/global.css" type=text/css rel=stylesheet>
<LINK media=screen href="/content/images/mkl/shopc.css" type=text/css rel=stylesheet>
<LINK media=screen href="/content/images/mkl/c.css" type=text/css rel=stylesheet>
<LINK media=screen href="/content/images/mkl/c2.css" type=text/css rel=stylesheet>
<LINK href="/content/images/mkl/mverify.css" type=text/css rel=stylesheet>
<STYLE type=text/css>.setp_1_list_bk IMG {
	VERTICAL-ALIGN: bottom
}
.shr LI {
	PADDING-BOTTOM: 7px
}
</STYLE>
 
<SCRIPT src="/content/images/mkl/jquery-1.3.2.min.js" type=text/javascript></SCRIPT>
<SCRIPT language=javascript type=text/javascript>


    var provinceId = "";
    function f_SetProv(value) {
        provinceId = value;
        document.all('ctl00_MainPlace_cmbProvince').value = value;

    }
    function f_PostalCodeErr() {
        isPostalErr = true;
    }



    var isPostalErr = false;

    function PostalCodeChange(obj) {

        //liMessage.style.display="inline-block";
        //liMessage.innerHTML = "请填写准确的邮编，以确保商品尽快送达";
        return true;

    }
	
 
	
    </SCRIPT>
 
<META content="MSHTML 6.00.6000.17092" name=GENERATOR></HEAD>
<BODY>
<headuc:uchead ID="headuc" runat="server" />
<FORM id=aspnetForm name=aspnetForm action=/order/order_address.aspx method=post>
<input type="hidden" name="action" id="action" value="checkmobile">
<DIV>
<DIV class=wrap>
<DIV class=step><A class=step1cur 
href="#"><SPAN>1.</SPAN><EM>收货地址</EM></A> 
<A class=step3><SPAN>2.</SPAN><EM>送货方式</EM></A> <A 
class=step2><SPAN>3.</SPAN><EM>付款方式</EM></A> <A 
class=step4><SPAN>4.</SPAN><EM>确认订单</EM></A> </DIV>
<DIV class=order-confirm-box>
<DIV class="bor2-gray mt10">
<H3 class="f14 blod Offerstitle">收货信息</H3>
<DIV class="ml10 mr10"><!--start haded address-->
<DIV class=dashed_div style="DISPLAY: none"></DIV>
<DIV class="borb mb10 mt10 send-info"><INPUT id=old-address type=radio 
value=0 name=AddressIndex><LABEL class=ml10 for=old-address0> <SPAN class=blod>收货信息：</SPAN><SPAN><%=model.RecName%></SPAN><SPAN 
class=ml10><%=model.RecAddress %></SPAN><SPAN class=ml10></SPAN><SPAN 
class=ml10><%=model.RecMobile%></SPAN><SPAN class=ml10><%=model.RecZip%></SPAN></LABEL> 
<UL></UL></DIV><!--end haded address-->
<DIV class="mt10 pl40" style="DISPLAY: block"><INPUT id=radioNewAddress 
type=radio CHECKED  value=1 name=AddressIndex><LABEL class=ml10 
for=radioNewAddress>输入新地址</LABEL> </DIV>
<DIV class="form-box mb10" id=naddress>
<DIV class="clearfix mt10"><LABEL for=receiver>收货人：</LABEL><INPUT 
  class="text short" id=ctl00_MainPlace_txtCustomerName 
  onblur=ContactNameChange(this) onfocus=ContactNameGet() maxLength=5 
  name=ctl00_MainPlace_txtCustomerName><SPAN class="etips ml10" 
  id=ErrorCustomerName>请填写您的真实姓名，最多五个汉字</SPAN><SPAN class="dtips ml10" 
  id=tipCustomerName>请填写您的真实姓名，最多五个汉字</SPAN> </DIV>
<DIV class="clearfix mt10"><LABEL for=postcode>邮编：</LABEL><INPUT 
  class="text short" id=ctl00_MainPlace_txtPostCode1 
  onblur=PostalCodeChange(this)  
  maxLength=6 name=ctl00_MainPlace_txtPostCode1><SPAN class="etips ml10" 
  id=ErrorPostCode>请填写准确的<A class=a2 
  href="http://cpdc.com.cn/postcdQueryAction.do?reqCode=gotoQueryPostAddr" 
  target=_blank>邮编（点这里查询）</A>，以确保商品尽快送达</SPAN></SPAN><SPAN class="dtips ml10" 
  id=tipPostCode>请填写准确的<A class=a2 
  href="http://cpdc.com.cn/postcdQueryAction.do?reqCode=gotoQueryPostAddr" 
  target=_blank>邮编（点这里查询）</A>，以确保商品尽快送达</SPAN> </DIV>
<DIV class="clearfix mt10"><LABEL for=province>所在省市：</LABEL>
<SELECT id=ctl00_MainPlace_cmbState style="DISPLAY: none" 
  name=ctl00_MainPlace_cmbState> <OPTION value=CN selected>中国</OPTION></SELECT> 
  <SELECT id=ctl00_MainPlace_cmbProvince 
  onchange="" name=ctl00_MainPlace_cmbProvince> 
    <OPTION value=安徽省>安徽省</OPTION> <OPTION 
    value=北京市 selected>北京市</OPTION> <OPTION value=福建省>福建省</OPTION> <OPTION 
    value=甘肃省>甘肃省</OPTION> <OPTION value=广东省>广东省</OPTION> <OPTION 
    value=广西>广西</OPTION> <OPTION value=贵州省>贵州省</OPTION> <OPTION 
    value=海南省>海南省</OPTION> <OPTION value=河北省>河北省</OPTION> <OPTION 
    value=河南省>河南省</OPTION> <OPTION value=黑龙江>黑龙江</OPTION> <OPTION 
    value=湖北省>湖北省</OPTION> <OPTION value=湖南省>湖南省</OPTION> <OPTION 
    value=吉林省>吉林省</OPTION> <OPTION value=江苏省>江苏省</OPTION> <OPTION 
    value=江西省>江西省</OPTION> <OPTION value=辽宁省>辽宁省</OPTION> <OPTION 
    value=内蒙古>内蒙古</OPTION> <OPTION value=宁夏>宁夏</OPTION> <OPTION 
    value=青海省>青海省</OPTION> <OPTION value=山东省>山东省</OPTION> <OPTION 
    value=山西省>山西省</OPTION> <OPTION value=陕西省>陕西省</OPTION> <OPTION 
    value=上海市>上海市</OPTION> <OPTION value=四川省>四川省</OPTION> <OPTION 
    value=天津市>天津市</OPTION> <OPTION value=西藏>西藏</OPTION> <OPTION 
    value=新疆>新疆</OPTION> <OPTION value=云南省>云南省</OPTION> <OPTION 
    value=浙江省>浙江省</OPTION> <OPTION value=重庆市>重庆市</OPTION></SELECT><input type="text"  class="text short" 
  id=ctl00_MainPlace_cmbCity onfocus=CityChangen(this) onblur=CityChange(this) 
  name=ctl00_MainPlace_cmbCity > <SPAN class="etips ml10" 
  id=CityError>城市名称不够详细</SPAN><SPAN class="dtips ml10" 
  id=tipCity>请输入城市址</SPAN> </DIV>
  
  <DIV class="clearfix mt10"><LABEL for=detail-address>详细地址：</LABEL>
    <input 
  class="text long" id=ctl00_MainPlace_txtAddress onBlur=AddressChange(this) 
  onFocus=AddressGet() name=ctl00_MainPlace_txtAddress>
    <SPAN class="etips ml10" 
  id=AddressError>收货人地址不够详细</SPAN><SPAN class="dtips ml10" 
  id=tipAddress>请填写您的详细地址</SPAN> </DIV>
  <DIV class="clearfix mt10"><LABEL for=mobile>移动电话：</LABEL><INPUT 
  class="text veriy-tips" id=ctl00_MainPlace_txtCellphone1 maxLength=11 
  name=ctl00_MainPlace_txtCellphone1> <SPAN 
  class="dtips ml10">手机号码是11位数字</SPAN><SPAN class="etips ml10" 
  id=ErrorCellphone1>请输入正确的手机号，是11位数字，且是13，14，15，18开头。</SPAN> </DIV>
 </DIV>
 
  <DIV class="clearfix mt10"></DIV>
</DIV></DIV></DIV>
<DIV class=mt10><INPUT class="confirm-address fl" id=ctl00_MainPlace_btnNext onClick="check();" type=button value=确认收货地址,下一步 name=ctl00$MainPlace$btnNext> 
<A class="sub-order-back ml10" 
href="/cart/cart">返回购物车，修改订单商品</A> 
</DIV></DIV></DIV>
<!--end address-->
<IMG height=1 alt="" src="/content/images/mkl/conversion.gif" width=1>
</DIV></form>
<footeruc:ucfooter ID="footeruc" runat="server" />
 
</BODY></HTML>
<SCRIPT type=text/ecmascript>
    $("input.veriy-tips").focus(function () {
        $(this).siblings(".etips").css("display", "none");
        $(this).siblings(".dtips").css("display", "inline-block");
    })
    $("input.veriy-tips").blur(function () {
        $(this).siblings(".dtips").css("display", "none");
    })
    $("#ctl00_MainPlace_txtCellphone1").blur(function () {
        var mp = $(this).val(), intMp = parseInt(mp).toString();

        if (mp.length != 11) {
            $(this).siblings(".etips").css("display", "inline-block");
            return;
        }
        if (intMp.length != 11) {
            $(this).siblings(".etips").css("display", "inline-block");
            return;
        }

        if (intMp.substring(0, 2) != 15 && intMp.substring(0, 2) != 13 && intMp.substring(0, 2) != 18 && intMp.substring(0, 2) != 14) {
            $(this).siblings(".etips").css("display", "inline-block");
            return;
        }
    })
       
 
        
    </SCRIPT>
 
<SCRIPT language=javascript type=text/javascript>

    function ContactNameChange(obj) {
        var regex = /^[\u4e00-\u9fa5]{0,}$/;
        if (Trim(obj.value).length == 0) {
            document.getElementById("tipCustomerName").style.display = "None";
            document.getElementById("ErrorCustomerName").style.display = "inline-block";
            document.getElementById("ErrorCustomerName").innerHTML = "请填写您的真实姓名，最多五个汉字";
        } else
            if (!regex.test(Trim(obj.value))) {
                document.getElementById("tipCustomerName").style.display = "None";
                document.getElementById("ErrorCustomerName").style.display = "inline-block";
                document.getElementById("ErrorCustomerName").innerHTML = "请输入正确的汉字";
            }
            else {
                document.getElementById("ErrorCustomerName").style.display = "None";
                document.getElementById("tipCustomerName").style.display = "None";
            }

        if (Trim(obj.value).length == 0) {
            document.getElementById("tipCustomerName").style.display = "None";
            document.getElementById("ErrorCustomerName").style.display = "inline-block";
            document.getElementById("ErrorCustomerName").innerHTML = "请填写您的真实姓名，最多五个汉字";
        }
    }
    function ContactNameGet() {
        document.getElementById("tipCustomerName").style.display = "inline-block";
        document.getElementById("ErrorCustomerName").style.display = "None";
    }
    function PostCodeGet() {
        document.getElementById("tipPostCode").style.display = "inline-block";
        document.getElementById("ErrorPostCode").style.display = "None";
    }

    function AddressGet() {
        document.getElementById("tipAddress").style.display = "inline-block";
        document.getElementById("AddressError").style.display = "None";
    }
    function AddressChange(obj) {
        if (Trim(obj.value).length < 6) {
            document.getElementById("AddressError").style.display = "inline-block";
            document.getElementById("tipAddress").style.display = "none";
            document.getElementById("AddressError").innerHTML = "收货人地址不够详细";

            return false;
        }
        else {
            document.getElementById("AddressError").style.display = "None";
            document.getElementById("tipAddress").style.display = "None";
        }
        if (Trim(obj.value).length > 0) {
            var reg = /[\u4E00-\u9FA5]/g
            if (!reg.test(obj.value)) {
                document.getElementById("AddressError").style.display = "inline-block";
                document.getElementById("tipAddress").style.display = "none";
                document.getElementById("AddressError").innerHTML = "请填写准确的详细地址，以确保商品尽快送达";

                return false;
            }
        }

    }

    function CityChangen(obj) {
        document.getElementById("tipCity").style.display = "inline-block";
        document.getElementById("CityError").style.display = "None";
    }
    function CityChange(obj) {
        if (Trim(obj.value).length < 2) {
            document.getElementById("tipCity").style.display = "None";
            document.getElementById("CityError").style.display = "inline-block";
            document.getElementById("CityError").innerHTML = "城市地址不够详细";

            return false;

        }
        else {
            document.getElementById("CityError").style.display = "None";
            document.getElementById("tipCity").style.display = "None";
        }
    }

    function Trim(str) {    /** 去掉空格方法*/
        return ToCDB(str).replace(/(^\s*)|(\s*$)/g, "");
    }
    function ToCDB(str) {
        var tmp = "";
        for (var i = 0; i < str.length; i++) {
            if (str.charCodeAt(i) == 12288) {   /** 去掉全角空格方法*/
                tmp += String.fromCharCode(32);
            }
            else {
                tmp += String.fromCharCode(str.charCodeAt(i));
            }
        }
        return tmp
    }       
 
    </SCRIPT>
 
<SCRIPT language=javascript type=text/javascript>




    function check() {

        var oaddress = document.getElementById("old-address")
        if (oaddress.checked) {

            this.location.href = "/order/order_ship";

        }


        var cellphone = document.getElementById("ctl00_MainPlace_txtCellphone1").value;
        var postcode = document.getElementById("ctl00_MainPlace_txtPostCode1").value;
        var cmbProvince = document.getElementById("ctl00_MainPlace_cmbProvince").value;
        var cmbCity = document.getElementById("ctl00_MainPlace_cmbCity").value;
        var txtAddress = document.getElementById("ctl00_MainPlace_txtAddress").value;
        var customername = document.getElementById("ctl00_MainPlace_txtCustomerName").value;

        if (Trim(cellphone).length == 0 || Trim(cellphone).length != 11) {
            document.getElementById("ErrorCellphone1").style.display = "inline-block";
            return false;
        }
        if (document.getElementById("ErrorCellphone1").style.display == "inline-block") {
            return false;
        }
        if (Trim(postcode).length == 0) {
            document.getElementById("ErrorPostCode").style.display = "inline-block";
            return false;
        }
        if (document.getElementById("ErrorPostCode").style.display == "inline-block") {
            return false;
        }
        if (Trim(cmbProvince).length == 0 || Trim(cmbCity).length == 0) {
            document.getElementById("ErrorPostCode").style.display = "inline-block";
            return false;
        }
        if (Trim(txtAddress).length < 6) {
            document.getElementById("AddressError").style.display = "inline-block";
            return false;
        }
        if (Trim(customername).length == 0) {
            document.getElementById("ErrorCustomerName").style.display = "inline-block";
            return false;
        }



        aspnetForm.submit();
    }
 
    
    </SCRIPT>
 
<SCRIPT src="/content/images/mkl/comm.js" type=text/javascript></SCRIPT>
 
<SCRIPT src="/content/images/mkl/o_code.js" type=text/javascript></SCRIPT>

